/*
 * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <tencentcloud/yunjing/v20180228/model/WeeklyReportMalware.h>

using TencentCloud::CoreInternalOutcome;
using namespace TencentCloud::Yunjing::V20180228::Model;
using namespace rapidjson;
using namespace std;

WeeklyReportMalware::WeeklyReportMalware() :
    m_machineIpHasBeenSet(false),
    m_filePathHasBeenSet(false),
    m_md5HasBeenSet(false),
    m_findTimeHasBeenSet(false),
    m_statusHasBeenSet(false)
{
}

CoreInternalOutcome WeeklyReportMalware::Deserialize(const Value &value)
{
    string requestId = "";


    if (value.HasMember("MachineIp") && !value["MachineIp"].IsNull())
    {
        if (!value["MachineIp"].IsString())
        {
            return CoreInternalOutcome(Error("response `WeeklyReportMalware.MachineIp` IsString=false incorrectly").SetRequestId(requestId));
        }
        m_machineIp = string(value["MachineIp"].GetString());
        m_machineIpHasBeenSet = true;
    }

    if (value.HasMember("FilePath") && !value["FilePath"].IsNull())
    {
        if (!value["FilePath"].IsString())
        {
            return CoreInternalOutcome(Error("response `WeeklyReportMalware.FilePath` IsString=false incorrectly").SetRequestId(requestId));
        }
        m_filePath = string(value["FilePath"].GetString());
        m_filePathHasBeenSet = true;
    }

    if (value.HasMember("Md5") && !value["Md5"].IsNull())
    {
        if (!value["Md5"].IsString())
        {
            return CoreInternalOutcome(Error("response `WeeklyReportMalware.Md5` IsString=false incorrectly").SetRequestId(requestId));
        }
        m_md5 = string(value["Md5"].GetString());
        m_md5HasBeenSet = true;
    }

    if (value.HasMember("FindTime") && !value["FindTime"].IsNull())
    {
        if (!value["FindTime"].IsString())
        {
            return CoreInternalOutcome(Error("response `WeeklyReportMalware.FindTime` IsString=false incorrectly").SetRequestId(requestId));
        }
        m_findTime = string(value["FindTime"].GetString());
        m_findTimeHasBeenSet = true;
    }

    if (value.HasMember("Status") && !value["Status"].IsNull())
    {
        if (!value["Status"].IsString())
        {
            return CoreInternalOutcome(Error("response `WeeklyReportMalware.Status` IsString=false incorrectly").SetRequestId(requestId));
        }
        m_status = string(value["Status"].GetString());
        m_statusHasBeenSet = true;
    }


    return CoreInternalOutcome(true);
}

void WeeklyReportMalware::ToJsonObject(Value &value, Document::AllocatorType& allocator) const
{

    if (m_machineIpHasBeenSet)
    {
        Value iKey(kStringType);
        string key = "MachineIp";
        iKey.SetString(key.c_str(), allocator);
        value.AddMember(iKey, Value(m_machineIp.c_str(), allocator).Move(), allocator);
    }

    if (m_filePathHasBeenSet)
    {
        Value iKey(kStringType);
        string key = "FilePath";
        iKey.SetString(key.c_str(), allocator);
        value.AddMember(iKey, Value(m_filePath.c_str(), allocator).Move(), allocator);
    }

    if (m_md5HasBeenSet)
    {
        Value iKey(kStringType);
        string key = "Md5";
        iKey.SetString(key.c_str(), allocator);
        value.AddMember(iKey, Value(m_md5.c_str(), allocator).Move(), allocator);
    }

    if (m_findTimeHasBeenSet)
    {
        Value iKey(kStringType);
        string key = "FindTime";
        iKey.SetString(key.c_str(), allocator);
        value.AddMember(iKey, Value(m_findTime.c_str(), allocator).Move(), allocator);
    }

    if (m_statusHasBeenSet)
    {
        Value iKey(kStringType);
        string key = "Status";
        iKey.SetString(key.c_str(), allocator);
        value.AddMember(iKey, Value(m_status.c_str(), allocator).Move(), allocator);
    }

}


string WeeklyReportMalware::GetMachineIp() const
{
    return m_machineIp;
}

void WeeklyReportMalware::SetMachineIp(const string& _machineIp)
{
    m_machineIp = _machineIp;
    m_machineIpHasBeenSet = true;
}

bool WeeklyReportMalware::MachineIpHasBeenSet() const
{
    return m_machineIpHasBeenSet;
}

string WeeklyReportMalware::GetFilePath() const
{
    return m_filePath;
}

void WeeklyReportMalware::SetFilePath(const string& _filePath)
{
    m_filePath = _filePath;
    m_filePathHasBeenSet = true;
}

bool WeeklyReportMalware::FilePathHasBeenSet() const
{
    return m_filePathHasBeenSet;
}

string WeeklyReportMalware::GetMd5() const
{
    return m_md5;
}

void WeeklyReportMalware::SetMd5(const string& _md5)
{
    m_md5 = _md5;
    m_md5HasBeenSet = true;
}

bool WeeklyReportMalware::Md5HasBeenSet() const
{
    return m_md5HasBeenSet;
}

string WeeklyReportMalware::GetFindTime() const
{
    return m_findTime;
}

void WeeklyReportMalware::SetFindTime(const string& _findTime)
{
    m_findTime = _findTime;
    m_findTimeHasBeenSet = true;
}

bool WeeklyReportMalware::FindTimeHasBeenSet() const
{
    return m_findTimeHasBeenSet;
}

string WeeklyReportMalware::GetStatus() const
{
    return m_status;
}

void WeeklyReportMalware::SetStatus(const string& _status)
{
    m_status = _status;
    m_statusHasBeenSet = true;
}

bool WeeklyReportMalware::StatusHasBeenSet() const
{
    return m_statusHasBeenSet;
}

